package com.mall.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mall.dubbo.mappers.UmsMemberLevelMapper;
import com.tanhua.model.domain.UmsMemberLevel;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class UmsMemberLevelApiImpl implements UmsMemberLevelApi{

    @Autowired
    private UmsMemberLevelMapper umsMemberLevelMapper;

    /**
     * 查询所有会员等级
     * @param umsMemberLevel
     * @return
     */
    @Override
    public List<UmsMemberLevel> find(UmsMemberLevel umsMemberLevel) {
        LambdaQueryWrapper<UmsMemberLevel> lqw = new LambdaQueryWrapper<>();
        lqw.eq(umsMemberLevel.getDefaultStatus() != null ,UmsMemberLevel::getDefaultStatus,umsMemberLevel.getDefaultStatus());
        return umsMemberLevelMapper.selectList(lqw);

    }
}
